<?php
namespace Home\Common;

class VisitLog{
	static function writeLog($action){
		$handle=fopen(C('VisitLog'),'a+');
		
		$date=date("Y/m/d h:i:s");
		$ip=$_SERVER['REMOTE_ADDR'];
		if($ip=="::1") $ip="127.0.0.1";
		$logInfo	=	$date.",".$ip.",".session('username').",".$action."\r\n";
		
		fwrite($handle,$logInfo);
		
		fclose($handle);
	}
}
?>